<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="app">
        <div>
            <input type="text" name="" id="" v-model="ipt">
            <button @click="add">添加</button>
        </div>
        <h3>未完成任务</h3>
        <div  v-for="(item,index) in taxt" >
            <input type="checkbox" name="" id="" @click="xx(index)" >
            {{item.ipt}}
            <button @click="c(index)">删除</button>
        </div>
        <h3>已完成任务</h3>
        <div  v-for="(item,index) in newtaxt">
            <input type="checkbox" name="" id="" @click="x2(index)" checked>
            {{item.ipt}}
            <button @click="c(index)">删除</button>
        </div>
    </div>
    <script src="https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js"></script>
    <script>
        let vm = new Vue({
            el:'#app',
            data:{
                ipt:'',
                taxt:[],
                newtaxt:[],
            },
            methods:{
                add() {
                  let obj ={
                      ipt:this.ipt,
                  }
                  this.taxt.push(obj)
                  this.ipt='';
                  console.log(this.taxt);
                },
                c(i){
                    this.taxt.splice(i,1)
                },
                xx(i){
                    this.newtaxt.push(this.taxt[i])
                    this.taxt.splice(i,1)
                },
                x2(i){
                    this.taxt.push(this.newtaxt[i])
                    this.newtaxt.splice(i,1)
                }
            }
        })
    </script>
</body>
</html>